﻿@{
    Layout = null;
    string docClsName = ViewData["docClsName"] == null ? "科室导航" : ViewData["docClsName"].ToString();
    string docClsCd = ViewData["docClsCd"] == null ? "" : ViewData["docClsCd"].ToString();
    string deptName = ViewData["FDeptName"] == null ? "" : ViewData["FDeptName"].ToString();
    string FDeptNo = ViewData["FDeptNo"] == null ? "" : ViewData["FDeptNo"].ToString();
    string logUrl = string.IsNullOrEmpty(ViewData["logUrl"].ToString()) ? Url.Content("~/Content/template/top01.jpg") : Url.Content(ViewData["logUrl"].ToString());
}
@model ElingOA6_DSJCJ.Model.Document
           
@{
    Dictionary<string, string> dicDocClsNameList = ViewData["dicDocClsNameList"] == null ? new Dictionary<string, string>() : ViewData["dicDocClsNameList"] as Dictionary<string, string>;
   
}

@helper  GetConfigShowText(string keyName, Dictionary<string, string> dicDocClsNameList)
    {
        if (dicDocClsNameList.ContainsKey(keyName))
        {
    @:@dicDocClsNameList[keyName]
       }
    }
<!DOCTYPE html>

<html>
<head>
    <title>@ElingOA6_DSJCJ.Common.GlobalConstant.CONSTRING_SYSTITLE</title>
     <link href="@Url.Content("~/Content/1.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    
<script src="@Url.Content("~/Scripts/ntko.js", true)" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script type="text/javascript">
     var docId=@Model.FDocId;

    //发布信息
    function btnOk() {
        docId = $("#hidDocId").val();
        var txtCon = $.trim($('#txtCon').val());
        if (txtCon == "") {
            alert("请输入内容");
            $('#txtCon').focus();
            return;
        }

        //$('#txtCon').attr("disabled", "disabled");

        if ($('#txtCon').val() != "") {
            $.ajax({
                type: 'POST',
                url: '/Index/DocLeadInstruct',
                data: { docid: docId, content: txtCon },
                success: function (result) {
                    if (result == "empty") {
                        alert("请重新登录或者输入文本内容");
                    }
                    else if (result == "yes") {

                        alert("批示成功");

                        window.location = window.location.href;
                    }
                    else {
                        alert("批示失败");
                    }

                    //$('#txtCon').removeAttr("disabled");
                }
            });
        }
    }

    function btnDel() {
        docId = $("#hidDocId").val();
        $.ajax({
            type: 'POST',
            url: '/Index/DelInstruct',
            data: { docid: docId },
            success: function (result) {
                if (result == "empty") {
                    alert("删除失败");
                }
                else {
                    alert(result);
                    window.location = window.location.href;
                }
            }

        });
    }
    //获取批示内容
    function btnUpdate() {
        docId = $("#hidDocId").val();
        $.ajax({
            type: 'POST',
            url: '/Index/GetInstruct',
            data: { docid: docId },
            success: function (result) {
                if (result == "empty") {
                    alert("获取失败");
                }
                else {
                    $('#txtCon').focus();
                    $("#txtCon").val(result);

                }
            }

        });
    }
        function DocRefImp() {
            docId = $("#hidDocId").val();

            var entryModel = $("#hdDocRefImpCls").val();

            var obj = new Object();
            if (entryModel != "") {
                obj.Value = entryModel;
            }
            else {
                obj.Value = "";
            }
            var docClsList = window.showModalDialog("/Index/DocRefImpClsChoose?docID=" + docId, obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (docClsList) != "undefined") {

                var docClsHtml = JSON.parse(docClsList);
                var showText = "";
                for (var i = 0; i < docClsHtml.length; i++) {
                    showText += docClsHtml[i].Text + ",";
                }
                if (showText != "") {
                    showText = "此信息已被下列栏目引用：" + showText.substring(0, showText.lastIndexOf(','));
                }
                //            var docClsList=JSON.stringify(docClsHtml);
                $.ajax({
                    type: 'POST',
                    url: '/Index/AddDocRefImp',
                    data: { docid: docId, docClsList: docClsList },
                    success: function (result) {
                        if (result == "SUCCESS") {
                            //                        $("#hdDocRefImpCls").val(docClsList);
                            //                        $("#hdDocRefImpClsName").val(showText);
                            //                        $('#spanDocRefImp').html(showText);
                            alert('操作成功！');
                            window.location.reload();
                        }
                        else {
                            alert('操作失败，原因：' + result);
                        }
                    }

                });
            }
        }
    </script>
</head>
<body>
       
<div class="wrap">

<div class="header">
           @if (ViewData["fmode"].ToString() == "F")
     { 
       <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000"
        height="145">
        <param name="_cx" value="26458">
        <param name="_cy" value="3836">
        <param name="FlashVars" value="">
        <param name="Movie" value="@logUrl)">
        <param name="Src" value="@logUrl">
        <param name="WMode" value="Opaque">
        <param name="Play" value="-1">
        <param name="Loop" value="-1">
        <param name="Quality" value="High">
        <param name="SAlign" value="">
        <param name="Menu" value="-1">
        <param name="Base" value="">
        <param name="AllowScriptAccess" value="">
        <param name="Scale" value="ShowAll">
        <param name="DeviceFont" value="0">
        <param name="EmbedMovie" value="0">
        <param name="BGColor" value="">
        <param name="SWRemote" value="">
        <param name="MovieData" value="">
        <param name="SeamlessTabbing" value="1">
        <param name="Profile" value="0">
        <param name="ProfileAddress" value="">
        <param name="ProfilePort" value="0">
        <param name="AllowNetworking" value="all">
        <param name="AllowFullScreen" value="false">
        <param name="AllowFullScreenInteractive" value="false">
        <param name="IsDependent" value="0">
        <param name="movie" value="@logUrl">
        <param name="quality" value="high">
        <param name="wmode" value="opaque">
        <param name="swfversion" value="11.0.0.0">
        <!-- 此 param 标签提示使用 Flash Player 6.0 r65 和更高版本的用户下载最新版本的 Flash Player。如果您不想让用户看到该提示，请将其删除。 -->
        <param name="expressinstall" value="../Scripts/expressInstall.swf">
        <!-- 下一个对象标签用于非 IE 浏览器。所以使用 IECC 将其从 IE 隐藏。 -->
         <!--[if !IE]>-->
	    <object type="application/x-shockwave-flash" data="@logUrl" width="1000" height="145">
	      <!--<![endif]-->

        <param name="quality" value="high">
        <param name="wmode" value="opaque">
        <param name="swfversion" value="11.0.0.0">
        <param name="expressinstall" value="../Scripts/expressInstall.swf">
        <!-- 浏览器将以下替代内容显示给使用 Flash Player 6.0 和更低版本的用户。 -->
        <div>
            <h4>
                此页面上的内容需要较新版本的 Adobe Flash Player。</h4>
            <p>
                <a href="http://www.adobe.com/go/getflashplayer">
                    <img alt="获取 Adobe Flash Player" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
                        width="112" height="33"></a></p>
        </div>
    </object> </object>
     }
     else
     { 
	   <div style="width:1000px;height:148px;">

      <img  style=" width:1000px; height:148px;position:absolute;z-index:-10;" src="@logUrl" >
    
      <div class="header-img3" style=" width:1000px; height:148px ;">
    	<div class="header-logo"><span><img src="@Url.Content("~/Content/template/logo.gif")"></span><span class="header-name">宁波市地方税务局稽查局</span><span class="header-title">@deptName</span>
        
	   </div>
        </div>
    </div>
     }
    
    <div class="nav">
    <ul>
            <li><a href="@Url.Content("~/SubOffice/Template?FDeptNo=" + @ViewData["FDeptNo"])">首页</a></li>
        @if (dicDocClsNameList.Count > 0)
        {
            foreach (KeyValuePair<string, string> dicDocClsNameModel in dicDocClsNameList)
            {
                 
             <li><a href="@Url.Content("~/SubOffice/TemplateList?clsCd=" + @dicDocClsNameModel.Key + "&FDeptNo=" + @FDeptNo)">@dicDocClsNameModel.Value</a></li>
            }
        }
           
          
        </ul>
        <div class="return"><a href="@Url.Action("Index", "Index")">返回局首页</a></div>
    </div>
    
</div>
<div class="main">
	
    <div class="content" style=" width:1000px; margin-bottom:10px;">

	<div class="list_page">
    	<div class="where"><b>当前位置：</b><a href="@Url.Content("~/SubOffice/Template?FDeptNo=" + @ViewData["FDeptNo"])">首页</a>&gt;<a href="#">@ViewData["docName"]</a></div>
        <div class="article">
        <h2 class="c">@Model.FTitle</h2> 
         @{
             if (Model.FSubTitle != null && Model.FSubTitle != "")
             {
                @Html.Raw("<h3>" + Model.FSubTitle + "</h3>");
             }
             if (Model.FReferenceNo != null && Model.FReferenceNo != "")
             {
                @Html.Raw("<h4>" + Model.FReferenceNo + "</h4>");
             }
            } 
         @* <div>
               <span style="margin-right:700px;"></span>
                
            </div> *@
         <p class="info c mb10"><span>作者:@Model.FAuthor</span> &nbsp;<span>发布时间：@Model.FPubDate.ToString("yyyy-MM-dd")</span> <span>来源：@Model.FDeptName</span> <span>阅读次数：<span id="hits">@Model.FReadCnt.ToString()</span><span style="text-align:right; font-size:14px;">
                    @if (ElingOA6_DSJCJ.Common.OperateSession.get(ElingOA6_DSJCJ.Common.GlobalConstant.PARAM_LOGINID) != null)
                    {
                        <a onclick="DocRefImp()" href="javascript:" style="color:Red;">[引用]</a>
                    }
                </span> 
              </span> </p>
    <div class="article-box">
     <p>    @if (Model.FEditMode == "H")
            {
                    @Html.Raw(Model.FContentTxt)
            }
              </p>  
               @if (!string.IsNullOrEmpty(@Model.FDownTitle) & !string.IsNullOrEmpty(@Model.FDownDateString))
               {
          <p style="FONT-SIZE: 16px; FONT-FAMILY: 宋体; TEXT-ALIGN: right"> @Model.FDownTitle
          <br />
          @Model.FDownDateString
          </p>
               
         
               }
      </div>
       <div class="p4">
                @if (null != ViewData["docAttach"])
                {
                    List<ElingOA6_DSJCJ.Model.DocAttach> docAttachList = ViewData["docAttach"] as List<ElingOA6_DSJCJ.Model.DocAttach>;
                    if (docAttachList.Count > 0)
                    {
                    <table width="880" border="0" style="text-align: left" cellpadding="0" cellspacing="0" style="margin-top: 10px;">
                        <tr>
                            <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                <br />
                                附件:</td>
                        </tr>
                        @foreach (ElingOA6_DSJCJ.Model.DocAttach attachModel in docAttachList)
                        {
                            <tr>
                                <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Index/AttachDownLoad?attachID=@attachModel.FAttachID">@(string.IsNullOrEmpty(attachModel.FAttachDesc) ? attachModel.FAttachOldFileName : attachModel.FAttachDesc)</a></td>
                            </tr>
                        }
                    </table>
                    }
                }
            </div>
        @if (ViewData["FIsExamine"].ToString() == "Y")
        {
            using (Html.BeginForm("DocView", "Index", FormMethod.Post, new { id = "portForm" }))
            {
           @*局长批示的内容*@
           <table width="880" border="0" cellpadding="0" cellspacing="0"  style="margin-top:10px;">
          @{
                if (null != ViewData["leadInstruct"])
                {
                    System.Data.DataSet dslt = ViewData["leadInstruct"] as System.Data.DataSet;
                    if (dslt.Tables[0].Rows.Count > 0)
                    {


                        foreach (System.Data.DataRow row in dslt.Tables[0].Rows)
                        {
                            if (row["FEmplNo"].ToString() == ViewData["FEmplNo"].ToString())
                            {
                           <tr>
            <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                <span style="color: #a3bb50;">@row["FExamineDate"]</span>&nbsp;&nbsp;&nbsp;<span  onclick="btnUpdate()" style="color: blue;cursor:pointer;">修改</span>|<span onclick="btnDel()" style="color: blue;cursor:pointer;">删除</span> <br />
                <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>   
              </td>
          </tr>
                            }
                            else
                            {
                              <tr>
            <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                <span style="color: #a3bb50;">@row["FExamineDate"]</span><br />
                <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>     
              </td>
          </tr>
                            }
                        }


                    }
                }
          
              }
              @if (ViewData["FIsInstruct"].ToString() == "Y")
              {
              <tr align="center"><td style="font-size:14px;">局长批示:</td></tr>
              <tr align="center"><td>@*<input type="text" id="txtCon" />*@
              @Html.TextArea("txtCon", "", 3, 90, "sty")</td></tr>
              <tr align="center"><td><input type="button" onclick="btnOk();" value="确定" />
          
              </td></tr>
              }
              </table>
              
        <input id="hidEmplNo" type="hidden" value="@ViewData["FEmplNo"]" />
            }
        }
     @*信息引用*@
           <script type="text/javascript">
               $(function () {
                   $('#spanDocRefImp').html($('#hdDocRefImpClsName').val());
               });
           </script>
           <div style="width:880px; display:block; padding-top:10px; padding-bottom:10px;" align="left">
           <span id="spanDocRefImp" ></span>
           </div>
            @Html.Hidden("hdDocRefImpCls", ViewData["docRefImpClsJson"] == null ? "" : ViewData["docRefImpClsJson"].ToString())
            @Html.Hidden("hdDocRefImpClsName", ViewData["docRefImpClsName"] == null ? "" : ViewData["docRefImpClsName"].ToString())
            <input id="hidDocId" type="hidden" value="@ViewData["FDocId"]" />
    <div class="opt" style="width: 100%;">【 <a href="/Index/DocViewPrint?docId=@Model.FDocId" target="_blank">打印此页</a> | <a href="javascript:window.close();">关闭窗口</a> 】</div>
   </div>
    </div>
     <div class="clear"></div> 
     </div>
   
</div>
    

<div class="bottom">
	<div class=" bottom-nav"><a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage(window.location.href);">设为首页</a><a href="#" onclick="window.external.AddFavorite(location.href, document.title)";>加入收藏</a><a href="@Url.Content("~/ElingOA6_Admin_DSJCJ")">后台登陆</a></div>
    <div class="copyright">
    	@Html.Raw(ViewData["CopyRight"].ToString())
    </div>
</div>

    
    </div>
</body>
</html>
